UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qzsGVNjVhAerxbI8jWvORyg9hy7GVj4Amd4yTzy6370='
WHERE
key_id = '6e7d0065d63c97a3946746614a5effc7d9e2daf8cb8cc31c12144e084cff48ef'
AND (
token = 'qzsGVNjVhAerxbI8jWvORyg9hy7GVj4Amd4yTzy6370='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)