UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Oo99jbcsYfx/w7N7T75mlD/xaUui3WLYcqCFdO6wO5E='
WHERE
key_id = 'bccc3901efaaa103a182c2d36871ab756b27f5a96ff005eaffcb9a190b29ac0d'
AND (
token = 'Oo99jbcsYfx/w7N7T75mlD/xaUui3WLYcqCFdO6wO5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)