UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6iAOuLTbNAYs/dphf9sdMDp4gyHxtwA617PT3dEkzWY=' 
WHERE 
  key_id = '7686e27a73d99b76a76ed710543f41eba702ceb575890575f79d130df1a4785f' 
  AND (
    token = '6iAOuLTbNAYs/dphf9sdMDp4gyHxtwA617PT3dEkzWY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030