UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uIfhzIgogNT8LKMiKDGreEav2jhPc+S1KkSCByoq2Cw='
WHERE
key_id = 'b0dca8f6dcbdb4d9d9674009a198fb6fce15c205306e69afc69ca918876cc256'
AND (
token = 'uIfhzIgogNT8LKMiKDGreEav2jhPc+S1KkSCByoq2Cw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)