UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h4BxEGyNN/JD7Xs3VpT+53LSjBpmYYrZT3NLYZTxLxI='
WHERE
key_id = '472f70bd6d046f4134d00d33bcefe739243f1afe05feff2c65261d6b16b5b4fb'
AND (
token = 'h4BxEGyNN/JD7Xs3VpT+53LSjBpmYYrZT3NLYZTxLxI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)