UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '77NJj0FxGQHZbfWuxDcB84XTDwy5e7iE52yFwR+zOkI=' 
WHERE 
  key_id = '1207ee87aec956f3cfb83da7c340e723b58e7d94e360db679815977dc76158ac' 
  AND (
    token = '77NJj0FxGQHZbfWuxDcB84XTDwy5e7iE52yFwR+zOkI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026