UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lKKQMIzqs45rthXbBaRwoPZeeb7aeVxcD2+Bk4lo/S0='
WHERE
key_id = '42f60b292d36b88b4098d0194ccc8b86bda2fbabd639de4cb4453ec415a95c21'
AND (
token = 'lKKQMIzqs45rthXbBaRwoPZeeb7aeVxcD2+Bk4lo/S0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)