UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '60Rlg3fWB0ERvHOgGdLqi9ziarSunEIaarSi+vMeENo='
WHERE
key_id = 'ec5a2a7052d82e5a2377a9bd3f5bbb600e03a27c3598fac0819cd51519af1b26'
AND (
token = '60Rlg3fWB0ERvHOgGdLqi9ziarSunEIaarSi+vMeENo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)