UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4AhTTeYQ9PKknnOLKJAU8To7epway6OI4zh3PbcWs+s='
WHERE
key_id = '7b77272fc0ad706bc4f929955cd06b2e881558142c8936922fcf724d3b377878'
AND (
token = '4AhTTeYQ9PKknnOLKJAU8To7epway6OI4zh3PbcWs+s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)