UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wTbMubJLx8ipNyPRT36qxxLZXGbSu5W/USBzX7rNOig='
WHERE
key_id = 'd7c5e3332aedabf2ea47aaf9ef4a5bb7a34d87a98bce7bc58c9e4f05505108c0'
AND (
token = 'wTbMubJLx8ipNyPRT36qxxLZXGbSu5W/USBzX7rNOig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)