UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DocJNfWubnC2s5uWmdKo8QF1KQadTStkvihT6OVUHNA='
WHERE
key_id = '75858a84c38e8459f57c1198f50d2aefb63117e9e8f00f4dc373318909dcfef7'
AND (
token = 'DocJNfWubnC2s5uWmdKo8QF1KQadTStkvihT6OVUHNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)