UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lNH+DXeDs7klF8Hm7Vr39/U/pGJucSCxLcdaovdv8BE=' 
WHERE 
  key_id = '08b1e7063b5cb91441d1ab354d065b399557dab06feb75e1d4cf486f4d8d80c9' 
  AND (
    token = 'lNH+DXeDs7klF8Hm7Vr39/U/pGJucSCxLcdaovdv8BE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036