UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+x6gt9iu+Tzv2N3RdZejpF8+mptZsnIbJVQRGgllAoQ=' 
WHERE 
  key_id = '57a8894e5a6ae55e528e12c2218f84385149d29259a7f1d7f88cc90b6aad5b8a' 
  AND (
    token = '+x6gt9iu+Tzv2N3RdZejpF8+mptZsnIbJVQRGgllAoQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018