UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CjCB7v4IUXLi0bxjTfJYuk/tmyFCXE+Z0a/I/KyW+1g='
WHERE
key_id = 'c61a5070a443b80c00ae9b09394cfed8be515fd3d76f7a5512d5461663be84a7'
AND (
token = 'CjCB7v4IUXLi0bxjTfJYuk/tmyFCXE+Z0a/I/KyW+1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)