UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sfCCEJ4XDjA7JYHrFv1qEcj8V0y0lKOgmm84FlBlyUc='
WHERE
key_id = '9aebbc7567d9ad36225d88cf04af37cb066f6a9e6def4385fb3e70d9aa01fb88'
AND (
token = 'sfCCEJ4XDjA7JYHrFv1qEcj8V0y0lKOgmm84FlBlyUc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)