UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WzTis+qmNEjJQ+/6VVraF1ZAh8zthUzzTu5i83HYH2s='
WHERE
key_id = '5386e9fd2b739512990a3afbabd28bf0a46aab7d7073072abf1a4c01bec67cea'
AND (
token = 'WzTis+qmNEjJQ+/6VVraF1ZAh8zthUzzTu5i83HYH2s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)