UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bC0CBL+fvwwzlpgcrX164orJKs8/mSxTYD4LAyOXfuQ='
WHERE
key_id = 'e88141bbc1fa5ed30ac55009b860faf38b821c04a177f2a7d1b2bed464b0ef40'
AND (
token = 'bC0CBL+fvwwzlpgcrX164orJKs8/mSxTYD4LAyOXfuQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)