UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tpi/QwB5nomQTOUixoqHHsrHfQT2WzfSUqic+ucrMxw='
WHERE
key_id = 'dff629f66f89ce803cdef1bd1db78abccd7216b1170bf1d0cb932a056e5c99f5'
AND (
token = 'Tpi/QwB5nomQTOUixoqHHsrHfQT2WzfSUqic+ucrMxw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)