UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9btoXZQgKvu2RGVCXTKphZAbDweao+eXuIJ/e2DR4pY='
WHERE
key_id = 'ca1893c11021012a1aba0a42b28d086497e405049e46837cfb0332c83a362cc0'
AND (
token = '9btoXZQgKvu2RGVCXTKphZAbDweao+eXuIJ/e2DR4pY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)