UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Mh4yI5l8Ad+F5u6JItzcxjdNR2Lnlukf4sKPcYDfLE=' 
WHERE 
  key_id = '3ce8ceab1d5855705fb6315cfd327c2435d04dfbe217c9e5aca49b8819d746e6' 
  AND (
    token = '9Mh4yI5l8Ad+F5u6JItzcxjdNR2Lnlukf4sKPcYDfLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027