UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NUQaVGIMmC+rXiIGRQSlE4j57ZxIk+20Yz6s4Axd1wE='
WHERE
key_id = '870633677d47fc937b54924a34801bb0006953a0b73dffc10f5d52e645219063'
AND (
token = 'NUQaVGIMmC+rXiIGRQSlE4j57ZxIk+20Yz6s4Axd1wE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)