UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/bo25enkij69xl4/pLQ39RAhEhEP4OpZSg4Mz7+Hkvw='
WHERE
key_id = '0dede6e540d8be01287f860b858a2e0bfed3f1528d66584fe46bb4fad015a9fa'
AND (
token = '/bo25enkij69xl4/pLQ39RAhEhEP4OpZSg4Mz7+Hkvw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)