UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4m8BUIyy9pc7vwpzjTzPM0uBSnIJWOs4ywmRYxT9rJI=' 
WHERE 
  key_id = '604a10a3cbdb9a004d90ff1b3def446c0ac687cf9b91947a4878a3640f131b43' 
  AND (
    token = '4m8BUIyy9pc7vwpzjTzPM0uBSnIJWOs4ywmRYxT9rJI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033