UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BsFUFcwYgmmO0ctSjZEmTC+0F80qukXNTqhNUaBvzKg=' 
WHERE 
  key_id = '3ec49b9a29c7ee5706db07562432c6d0fd9f3d4d7636557ef5d960b82cd3c45c' 
  AND (
    token = 'BsFUFcwYgmmO0ctSjZEmTC+0F80qukXNTqhNUaBvzKg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034