UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VFRFur3T45aw6vWZeUr5XDAlYUXdg6sHr/7pZzVlWn8=' 
WHERE 
  key_id = '016ce398bc5c9a5d8a434921dca05ed619c5a5174900e6ca2f0b662e0e339722' 
  AND (
    token = 'VFRFur3T45aw6vWZeUr5XDAlYUXdg6sHr/7pZzVlWn8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033