UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SfNc/Uuirkb8ssYZuT/wzPg4J1beeW5A4gZIOAr7CGc='
WHERE
key_id = '84e5c0b94a7b86e49eeb8fbb46626b9f7915039e3c358a18dff391514e22f55d'
AND (
token = 'SfNc/Uuirkb8ssYZuT/wzPg4J1beeW5A4gZIOAr7CGc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)