UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'utEpbmnhXV6UlC2vwuZSDDvD7jm4qiGxs0g1vWipQvE=' 
WHERE 
  key_id = 'dc14f6991a892652c87159a12f90e816b1ad70dc6cf9de2612620c2bbf8c5a44' 
  AND (
    token = 'utEpbmnhXV6UlC2vwuZSDDvD7jm4qiGxs0g1vWipQvE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035