UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zbqtKCNjn5VnMFsNsAJifxbZLVkI3mXF2MwjgC82hrw=' 
WHERE 
  key_id = '1fd379397686941ed1d707c0ccd999c083e27b436a26ea6b988fd72e5e8c65f8' 
  AND (
    token = 'zbqtKCNjn5VnMFsNsAJifxbZLVkI3mXF2MwjgC82hrw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031