UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ngTPNgBg80Vnwb9PiEhbMJxVHkowSTGtk5dGySLA+AQ='
WHERE
key_id = 'bafd0fa48d871196fb91a52d03669f27dfa44490a18f31a99dabfbd594d25c2d'
AND (
token = 'ngTPNgBg80Vnwb9PiEhbMJxVHkowSTGtk5dGySLA+AQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)