UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yvivF+hqRkyDu9lTcP8ZRhIW9ZrXHoJAztcJdH9jnoo='
WHERE
key_id = '007f5c7c96ebae44bf168b40554568abd21b8c86bfb1fd14814f5b52fd3d981e'
AND (
token = 'yvivF+hqRkyDu9lTcP8ZRhIW9ZrXHoJAztcJdH9jnoo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)