UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kTjG90qvq/9HJX0eM+FXr0RyzZr1Vyk8ZTAY1ldlE6Q='
WHERE
key_id = 'd4cb3fc5887bea4231b238570a0189f1ebfac2c7851bc75ab4375419184dbb3a'
AND (
token = 'kTjG90qvq/9HJX0eM+FXr0RyzZr1Vyk8ZTAY1ldlE6Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)