UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yxc0MY6axUh5pSF72/Q+Nj2B7qjjNP/nMt0xcRll/SM=' 
WHERE 
  key_id = '34d282fbeef606254a074eaff198ad6dd70b5de86f69e28e3769040a8a6e03ca' 
  AND (
    token = 'yxc0MY6axUh5pSF72/Q+Nj2B7qjjNP/nMt0xcRll/SM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029