UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gXbFjIMqhoRsl8uMS7biRo2Bxqxh+hratl8jPy9txHk='
WHERE
key_id = 'b241ac7b8b5496869b9fba36cfe47f7490e2e0cee14b19f1bb0da1940be6b0ba'
AND (
token = 'gXbFjIMqhoRsl8uMS7biRo2Bxqxh+hratl8jPy9txHk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)