UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YrPteURtE8wz9PZXmlYaSsGx1Ts5N9/qBuLBtwtbj5w='
WHERE
key_id = 'b7731f7ba331a94450371121824e388449f5b66e2cb814f74c559873ae71a8e0'
AND (
token = 'YrPteURtE8wz9PZXmlYaSsGx1Ts5N9/qBuLBtwtbj5w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)