UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cylm+JDx9x3BSDkLM58Y4GEZA0pmHi4GZyq/d/OT/vE=' 
WHERE 
  key_id = '09cf89addb5503f577a8293d07ab1ed2bcc135ee03c20e6bbb95fdca224caec1' 
  AND (
    token = 'cylm+JDx9x3BSDkLM58Y4GEZA0pmHi4GZyq/d/OT/vE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022