UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dlOyHjgFNx8sr5vZIFyz72YDpCjEl9GvTUeFMoHdHnE='
WHERE
key_id = '0ba145d9027d225d14553a86dd0ebdfa172809fccec596c4d6f7fa27650ec875'
AND (
token = 'dlOyHjgFNx8sr5vZIFyz72YDpCjEl9GvTUeFMoHdHnE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)