UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'obmMUo3hgRr86bXyn5oRFldNvU6y9RWFb7QKG9RrbJ0=' 
WHERE 
  key_id = 'd05439a675d5392999b91f2608e3be32e66f570429a025cb53b65a292bdf2955' 
  AND (
    token = 'obmMUo3hgRr86bXyn5oRFldNvU6y9RWFb7QKG9RrbJ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021