UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DsqPJ1Ra/qEHLip3tqSApIaOQ5anbeoRSgpn5pMI0QI=' 
WHERE 
  key_id = '96aa4a4425005389c49bb7605536b0ea4d6ffbbb3e58fd7b708d1807f0844380' 
  AND (
    token = 'DsqPJ1Ra/qEHLip3tqSApIaOQ5anbeoRSgpn5pMI0QI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038