UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VFHnPBbeTr7oyQbqSqI0DkMZCyfCk5DPeJ7Ab+wE5wo='
WHERE
key_id = '5f09f4c43493e6c354757f327ca1b168216e82940ef31ed7e9ebb8d6f961b5f0'
AND (
token = 'VFHnPBbeTr7oyQbqSqI0DkMZCyfCk5DPeJ7Ab+wE5wo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)