UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+66VyC4VkhQ+056q4zI87FnXPmpn9iJ+uF7TkOzzZfQ=' 
WHERE 
  key_id = 'cefa18bba3229fa9584dd899d088603ca9afc9cc27d922f463130ac2719b0ac8' 
  AND (
    token = '+66VyC4VkhQ+056q4zI87FnXPmpn9iJ+uF7TkOzzZfQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039