UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8BA2Q15Quhzs0EnR4w9UYjI61YkcgNnj9reRyQw4hHc='
WHERE
key_id = '155d286aafb452e6e9cc06757a5d90cca2eed311e2d8feaa4062a965f529fe0f'
AND (
token = '8BA2Q15Quhzs0EnR4w9UYjI61YkcgNnj9reRyQw4hHc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)