UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iwQL2qAeN4cqIuoIK/64EqbcnYwfKzPK+NWSPFKRnT0=' 
WHERE 
  key_id = '36a16ae1ae7c40d925541bc7e1ad807aa5c18b03c2f28c5aa3bc4c1d876c4588' 
  AND (
    token = 'iwQL2qAeN4cqIuoIK/64EqbcnYwfKzPK+NWSPFKRnT0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038