UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4jdTW6qQ41YuTTF5DitUDzgNzPD2XEwjuziDpxZ4Fqk=' 
WHERE 
  key_id = '5360c34c9275e54936add370b8a2a42632bab17a36589386ca6d1e7e6e6eda11' 
  AND (
    token = '4jdTW6qQ41YuTTF5DitUDzgNzPD2XEwjuziDpxZ4Fqk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028