UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ujFjVIkepRingzEdseAbrdZInPBgwHIZ6TJPqBlh8ro=' 
WHERE 
  key_id = '61ae49340fd9f030548dded96b35c00db63de2f712c010bc7579c34527a4ee58' 
  AND (
    token = 'ujFjVIkepRingzEdseAbrdZInPBgwHIZ6TJPqBlh8ro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027