UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9CsJQ/T68mRaIOfkq4wCAlGVrj9VvroPuhAsHxdCoos=' 
WHERE 
  key_id = '80e3c1d815502450bddf16a26c84fab92e773a4cdc7d4f8cd65ca82a9c5ce01b' 
  AND (
    token = '9CsJQ/T68mRaIOfkq4wCAlGVrj9VvroPuhAsHxdCoos=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041